package com.blt.car.home.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.blt.car.R;

import java.util.ArrayList;
import java.util.List;

import blt.app_core.api.car.bean.Car;

/**
 * Created by xgp on 2017/6/18.
 */

public class CarInfoAdapter extends BaseAdapter {

    LayoutInflater inflater;
    String footName[] = {"车辆号码:", "车辆型号:", "车辆类型:", "车辆座位:"};

//    private Car car;
//    private List<String> carInfo = new ArrayList<>();

    public CarInfoAdapter(Context context) {
        inflater = LayoutInflater.from(context);
    }

//    public void add(Car car) {
//        carInfo.clear();
//        this.car = car;
//        notifyDataSetChanged();
//
//    }



    @Override
    public int getCount() {
        return  footName.length;
    }

    @Override
    public Object getItem(int position) {
        return footName[position];
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = inflater.inflate(R.layout.item_home_grid, parent, false);
        }
        TextView tFrontName = (TextView) convertView.findViewById(R.id.item_homegird_front);
        TextView data = (TextView) convertView.findViewById(R.id.item_homegird_data);
        tFrontName.setText(footName[position]);
//        if (carInfo.size() != 0) {
//            data.setText(carInfo.get(position));
//        }
        return convertView;
    }
}
